import { getAllBrandListService } from '@/api/commodity/common';
import { getUserInfoListService, getDepartmentsService } from '@/api/usercenter';
import { WHETHER_OPTIONS } from '@/constants/basics';

export const FORM_ITEMS = [
  {
    prop: 'categoryUuids',
    label: '品类',
    type: 'slot',
    slotName: 'category',
    defaultVal: []
  },
  {
    prop: 'skuNo',
    label: 'SKU编码',
    type: 'input',
  },
  {
    prop: 'brandUuid',
    label: '品牌',
    type: 'select',
    remote: true,
    remoteMethod: getAllBrandListService,
    paramKey: 'brandName',
    optionKeys: { valueKey: 'brandUuid', labelKey: 'brandName' },
  },
  {
    prop: 'productName',
    label: '商品名称',
    type: 'input'
  },
  {
    prop: 'canCustom',
    label: '是否定制',
    type: 'select',
    options: WHETHER_OPTIONS
  },
  {
    prop: 'manageHrAreaId',
    label: '商品管理区域',
    type: 'select',
    options: []
  },
  {
    prop: 'imageUpdateUserId',
    label: '图文完善发起人',
    type: 'select',
    remote: true,
    remoteMethod: getUserInfoListService,
    paramKey: 'userName',
    optionKeys: { valueKey: 'userIdStr', labelKey: 'userName', codeKey: 'jobNumber' }
  },
  {
    prop: 'imageUpdateTime',
    label: '图文完善发起时间',
    type: 'datePicker',
    valueFormat: 'yyyy-MM-dd'
  },
  {
    prop: 'imageUpdateDeptId',
    label: '图文完善发起部门',
    type: 'select',
    remote: true,
    remoteMethod: getDepartmentsService,
    paramKey: 'departmentName',
    optionKeys: { valueKey: 'departmentId', labelKey: 'departmentName' },
  },
]

export const TABLE_COLUMNS = [
  {
    title: 'SKU编码',
    key: 'skuNo'
  },
  {
    title: '末级分类',
    key: 'categoryName'
  },
  {
    title: '品牌',
    key: 'brandName'
  },
  {
    title: '商品名称',
    key: 'productName'
  },
  {
    title: '材质',
    key: 'material'
  },
  {
    title: '规格',
    key: 'specModel'
  },
  {
    title: '计量单位',
    key: 'unitName'
  },
  {
    title: '是否定制',
    key: 'canCustomStr'
  },
  {
    title: '特殊要求说明',
    key: 'note'
  },
  {
    title: '售卖平台',
    key: 'salePlatStr'
  },
  {
    title: '销售区域',
    key: 'saleAreaStr'
  },
  {
    title: '最小起售量',
    key: 'saleMin'
  },
  {
    title: '销售限制类型',
    key: 'saleResTypeStr'
  },
  {
    title: '图文完善发起人',
    key: 'imageUpdateUserName'
  },
  {
    title: '图文完善发起时间',
    key: 'imageUpdateTime'
  },
  {
    title: '图文完善发起部门',
    key: 'imageUpdateDept'
  },
  {
    title: '商品管理区域',
    key: 'manageAreaName'
  },
  {
    title: '图文完善状态',
    key: 'imageStatusStr',
    fixed: 'right'
  },
]
